import time
from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get("https://www.baidu.com")
新闻 = driver.find_element(By.LINK_TEXT,'新闻')
print(新闻)
print(新闻.get_attribute("outerHTML"))
print(driver.find_element(By.LINK_TEXT, 'hao123').get_attribute("outerHTML"))
driver.quit()